import React, { Fragment } from 'react'
import "./cell.less"
import { Checkbox ,Image} from 'react-vant'
export default function Cell(props) {
    return (
        <Fragment>
            {
                props.isCheck === 0 ? <div className='cell' onClick={props.click ? props.click : (props.getFirend ? props.getFirend : null)}>
                    <Checkbox checked={props.isCheced} checkedColor="#05c160" iconSize={20}></Checkbox>
                    <p style={{ paddingLeft: "10px" }} className={props.class ? `cell_icon ${props.class}` : 'cell_icon'}>
                        {
                            props.icon ? <svg className='icon' aria-hidden='true'>
                                <use xlinkHref={props.icon}></use>
                            </svg> : (props.img ? <img src={props.img} alt="" /> : <img src="https://pic3.zhimg.com/80/v2-437f4dc41f0f972f31921a228641cf9e_720w.jpg?source=1940ef5c" alt="" />)
                        }

                    </p>
                    <p className='cell_title'>
                        {props.title}
                    </p>
                </div> : <div className='cell' onClick={props.click ? props.click : (props.toFriendMsg ? props.toFriendMsg : null)}>
                        <div className={props.class ? `cell_icon ${props.class}` : 'cell_icon'}>
                            {
                                props.icon ? <svg className='icon' aria-hidden='true'>
                                    <use xlinkHref={props.icon}></use>
                                </svg> : <Image radius={5} src={props.img} alt="" />
                            }

                        </div>
                        <p className='cell_title'>
                            {props.title}
                        </p>
                    </div>
            }
        </Fragment>
    )
}
